<!--
 * @LastEditors: 杜康
 * @LastEditTime: 2021-11-17 16:20:55
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>绘制Tutorial案例</title>
</head>

<body>
  <div id="mountNode" />
  <script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
  <script>
    // 设置数据
    const initData = {
      // 点集合
      nodes: [{
        id: 'node1',
        x: 100,
        y: 200,
        label: '起始点'
      }, {
        id: 'node2',
        x: 300,
        y: 200,
        label: '终止点'
      }],
      // 边集合
      edges: [{
        source: 'node1',
        target: 'node2',
        label: '我是连线'
      }]
    }
    // 将图实例化
    const graph = new G6.Graph({
      container: 'mountNode',
      width: 800,
      height: 500
    })
    // 给图设置数值，渲染图
    graph.data(initData)
    graph.render()
  </script>
</body>

</html>